/**
 * @projectName: api-backend
 * @package: com.wangzz.apiclientsdk.client
 * @className: MessageClient
 * @author: wangzz
 * @description: TODO
 * @date: 2024/3/19 20:27
 * @version: 1.0
 */

package com.wangzz.apiclientsdk.client;

import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import com.wangzz.apiclientsdk.model.User;

import java.util.HashMap;

/**
 * @Author: wangzz
 * @Description: 短信客服端
 * @DateTime: 2024/3/19 20:27
 **/
public class MessageClient extends ApiClient {

    public MessageClient(String accessKey, String secretKey) {
        super(accessKey, secretKey);
    }

    public String getMessage(String phone) {
        HashMap<String, Object> hashMap = new HashMap<>();
        hashMap.put("phone", phone);
        String result = HttpUtil.createGet(REQUEST_URL + "/api/message")
                .addHeaders(getHeaderMap("", accessKey, secretKey))
                .form(hashMap)
                .execute()
                .body();
        System.out.println(result);
        return result;
    }
}